// Copyright (C) 2005-2008 Jae Stutzman (jaebird@gmail.com)
//
// This file is part of Podducer.
//
// Podducer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Podducer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Podducer.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Podducer
{
	/// <summary>
	/// Summary description for FrmCopyAnimate.
	/// </summary>
	public class FrmCopyAnimate : System.Windows.Forms.Form
	{
		private delegate void InvokeHandlerDelegate2(int progress);
		private ProgressBar copyProgressBar;

		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public int Progress
		{
			get
			{
				return copyProgressBar.Value;
			}
			set
			{
				SetProgressBar(value);
			}
		}

		private void SetProgressBar(int progress)
		{
			lock (this)
			{
				if (this.InvokeRequired)
				{
					BeginInvoke(new InvokeHandlerDelegate2(SetProgressBar), progress);
				}
				else
				{
					copyProgressBar.Value = progress;
				}
			}
		}

		public FrmCopyAnimate()
		{
			// Required for Windows Form Designer support
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.copyProgressBar = new System.Windows.Forms.ProgressBar();
			this.SuspendLayout();
			// 
			// copyProgressBar
			// 
			this.copyProgressBar.Location = new System.Drawing.Point(12, 12);
			this.copyProgressBar.Name = "copyProgressBar";
			this.copyProgressBar.Size = new System.Drawing.Size(227, 23);
			this.copyProgressBar.TabIndex = 0;
			// 
			// FrmCopyAnimate
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(250, 47);
			this.ControlBox = false;
			this.Controls.Add(this.copyProgressBar);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Name = "FrmCopyAnimate";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Copy In Progress...";
			this.ResumeLayout(false);

		}
		#endregion
	}
}
